export enum ApiCode {
  Success = 200,
  Fail = 100,
  TokenExpired = 101,
  NoPermission = 400,
  NotLogin = 103,
}

export class Page {
  pageSize!: number;
  pageIndex!: number;
  total?: number;
  order?: string;
}

export class ApiResult<T> {
  page!: Page | null;
  msg!: string;
  apiCode!: ApiCode;
  result!: T;
}

export const enum RequestUrlEnum {
  userGetList = '/user/getList',
  userById = '/user/getSingleUser',
  userInsert = '/user/addUser',
  userDelete = '/user/deleteUser',
  userUpdate = '/user/updateUser',
  userLoginInfo = '/user/getUserInfoByToken',
  userLogout = '/user/logout',
  userLogin = '/user/login',

  testGetList = '/test/getTestList',
  testInsert = '/test/insertTest',
  testUpdate = '/test/updateTest',
  testById = '/test/getById'
}

export class AuthToken{
  token!: string;
}

export type Method = "get" | "post"
